package tournamentData;

public class Target implements Comparable < Target > {
	private final int number;
	private final char character;

	public Target(int number, char character) {
		this.number = number;
		this.character = character;
	}

	public int getNumber() {
		return this.number;
	}

	public char getCharacter() {
		return this.character;
	}

	@Override
	public String toString() {
		return new Integer(this.number).toString() + this.character;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Target) {
			if (((Target) obj).getNumber() == this.number) {
				if (((Target) obj).getCharacter() == this.character) {
					return true;
				}
			}
		}
		return false;
	}

	@Override
	public int compareTo(Target o) {
		if (this.getNumber() < o.getNumber()) {
			return -1;
		} else if ((this.getNumber() == o.getNumber()) && (this.getCharacter() < o.getCharacter())) {
			return -1;

		} else if ((this.getNumber() == o.getNumber()) && (this.getCharacter() == o.getCharacter())) {
			return 0;
		} else {
			return 1;
		}
	}
}
